function popup(page,title,w,h) {
	hwnd = window.open(page,title,'scrollbars=yes,resizable=yes,width='+w+',height='+h+',left=400, LOCATIONBAR=YES, STATUSBAR=YES');
	hwnd.focus();
}
function charInString(str,v) {
	var strArray = v.split(';');
	for (var i=0; i < strArray.length; i++) {
		if(str.indexOf(strArray[i]) > -1) {
			return true;
		}
	}
	return false;
}
function contains(list,val) {
	for(i=0;i<list.length;i++) {
		if(list[i].text == val) {
			return true;
			break;
		}
	}
	return false;
}
function containsExcepted(list,val,old) {
	for(i=0;i<list.length;i++) {
		if(list[i].text == val && list[i].text != old) {
			return true;
			break;
		}
	}
	return false;
}
function checkValue(frm,radioName) {
	var val;
  	for (var i=0; i<frm.elements.length; i++) {
      	if ((frm.elements[i].name.indexOf(radioName) > -1)) {
        	if (frm.elements[i].checked) {
            	val=frm.elements[i].value;
          	}
      	}
  	}
  	return val;
}

function isNumber(string) {
    if (string.length == 0)
        return false;
    for (var i=0;i < string.length;i++)
        if ((string.substring(i,i+1) < '0') || (string.substring(i,i+1) > '9'))
            return false;
    return true;
}
function trim(strText) { 
    // this will get rid of leading spaces 
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);
    // this will get rid of trailing spaces 
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);
   return strText;
} 
function unAllowedChars(string,regex){
	var res;
	res = string.match(regex);
	return res; 
}
function closePopup(){
		this.opener.focus();
		window.close();

}